
import type { RouteRecordRaw } from "vue-router"


const routes: RouteRecordRaw[] = [
    {
        path: '/',
        redirect: { name: 'login' }
    },
    {
        path: '/login',
        name: 'login',
        // component: () => import('../views/LoginView.vue'),
        redirect: { name: 'user' },
        children: [
            {
                path: 'user',
                name: 'user',
                component: () => import('../LoginComponent/UserLogin.vue')
            },
            {
                path: 'register',
                name: 'register',
                component: () => import('../LoginComponent/LoginRegister.vue')
            }
        ]
    },
    {
        path: '/admin',
        name: 'admin',
        component: () => import('../views/HomeView.vue'),
        redirect: { name: 'home' },
        children: [
            {
                path: 'home',
                name: 'home',
                component: () => import('../HomeView/home.vue')
            },
            {
                path:'class',
                name:'class',
                component:() => import('../classification/classView.vue')
            },
            {
                path:'mine',
                name:'mine',
                component:() => import('../mine/mineView.vue')
            }
        ]
    },
    {
        path:'/product/:proid',
        name:'product',
        component:()=> import('../views/productView.vue')
    },
    {
        path:'/cart',
        name:'cart',
        component:() => import('../views/cartView.vue')
    },
    {
        path:'/404',
        name:'404',
        component: () => import('../views/404.vue')
    }
]
export default routes